<template>
  <view class="video-container">
    <video ref="video" :src="src"></video>
  </view>
</template>

<script>
export default {
  props: {
    src: {
      type: Object,
      default: null
    }
  },
  mounted() {
    this.$refs.video.srcObject = this.src
    this.$refs.video.play()
  }
}
</script>

<style>
.video-container {
  width: 100%;
  height: 100%;
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
</style>